# include haproxy admin webui upstream definition
include /etc/nginx/conf.d/haproxy/upstream-*.conf;

server {
    listen       {{ repo_port | default('80') }} default_server;
    server_name  localhost;

    # home server (yum repo server)
    location / {
        root        {{ repo_home|default('/www') }};
        index       index.html;
        autoindex   on;
        autoindex_exact_size on;
        autoindex_localtime on;
        autoindex_format html;
    }

    # liveness probe
    location /nginx {
        stub_status on;
        access_log off;
    }

    # proxy pass haproxy admin webui requests
    include /etc/nginx/conf.d/haproxy/location-*.conf;
}

